<%-- 
    Document   : addNewUser
    Created on : 26.07.2009, 16:15:02
    Author     : Mario
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="../STYLES/serverStyles.css" />
        <jsp:useBean id="consumers" scope="session" class="de.stalinski.db.ConsumersConnector" />
         <jsp:useBean id="creator" scope="session" class="de.stalinski.util.UserCreator" />
 <title>FBIS - ADMIN / BENUTZER HINZUFÜGEN</title>
    </head>
    <body>
        <%
        String fn = request.getParameter("fn");
        String sn = request.getParameter("sn");
        String un = request.getParameter("un");
        String id = request.getParameter("id");
        String mail = request.getParameter("mail_two");
        String pass = request.getParameter("pass");
        String admin = request.getParameter("admin");
        String intern = request.getParameter("intern");
        String status = request.getParameter("status");
        un = creator.generateUser(fn, sn);
        boolean stat=consumers.addUser(fn, sn, mail, un, pass, admin, status, intern);
        if(stat) {
            out.print("User erfolgreich angelegt!");
            %><meta http-equiv="refresh" content="1;users.jsp"><%
        } else {
            out.print("Anlegen des neuen Users nicht erfolgreich!");
            %><meta http-equiv="refresh" content="1;users.jsp"><%
        }
        %>
    </body>
</html>
